package com.jlkf.service.util;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * 语言返回切换
 * @author DN
 *
 */
public class LanguageUtils {
   
	public static String returnLan(Integer myLanguage,String context){
		String _return="";
		ResourceBundle rb = null;
		Locale locale =null;
		//根据不同的请求创建不同的语言环境信息  
		switch (myLanguage) {
		case 1:
			 locale = Locale.CHINA;
				// 获得资源文件 
			   rb = ResourceBundle.getBundle("i18n/message_zh_CN", locale);
			   _return = rb.getString(context);
			   break;
        case 2:
        	locale = Locale.US;
			// 获得资源文件 
		   rb = ResourceBundle.getBundle("i18n/message_en_US", locale);
		   _return = rb.getString(context);
			break;
		default :
			locale = Locale.US;
			// 获得资源文件 
		   rb = ResourceBundle.getBundle("i18n/message_en_US", locale);
		   _return = rb.getString(context);
		}
		
		return _return;
		
	} 
}
